<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>用户列表</title>
		<#include "../include/base.ftl">
		<style type="text/css">
			#role-list-box input{height:25px;}
		</style>
	</head>
	<body>
		<div id="user-list-btn" class="search-box">
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch()">查询</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-reload" plain="true" onclick="resetSearchBox()">重置</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:showAddBox();">新增</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="javascript:showEditBox();">修改</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:deleteUser();">刪除</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-man" plain="true" onclick="javascript:resetPassword();">重设置密码</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-man" plain="true" onclick="javascript:setRole();">分配角色</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-man" plain="true" onclick="javascript:setSite();">设置站点</a>
			<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="refreshAuth()">刷新权限</a>
			&nbsp;&nbsp;
			<br/>
			<span class="search-label">用户名:</span>
			<input id="username" class="easyui-textbox search-input">
			<span class="search-label">姓名:</span>
			<input id="realname" class="easyui-textbox search-input">
			<span class="search-label">有效否:</span>
			<input id="queryuserStatusList" class="easyui-combobox search-input" editable="false"/> 		    				
		</div>
		
		<table id="user-list-box" class="easyui-datagrid" style="width:100%;" toolbar="#user-list-btn"
				title="用户列表" iconCls="icon-save" url="user/list_data" singleSelect=true
				rownumbers="true" pagination="true" pageSize=10  pageList=[10,20,30,40,50]  pageNumber=1>
			<thead>
				<tr>
					<th field="id" width="60" align="center" checkbox=true>ID</th>
					<th field="username" width="120" align="center">用户名</th>
					<th field="realname" width="120" align="center">姓名</th>
					<th field="email" width="200" align="center">邮箱地址</th>
					<th field="status" width="80" align="center" formatter="formatStat">状态</th>
					<th field="createUser" width="120" align="center">创建人</th>
					<th field="createTime" width="150" align="center">创建日期</th>
					<th field="updateUser" width="120" align="center">修改人</th>
					<th field="updateTime" width="150" align="center">修改日期</th>
				</tr>
			</thead>
		</table>
		
		<div id="edit-user-box" class="easyui-window add-box" title="编辑用户信息" style="width:460px;height:320px;display:none;left: 60px; top: 50px;"  
		        closed="true" modal="true" collapsible="false" minimizable="false" maximizable="false" resizable="false">  
		    <form action="user/save_user" method="post" id="edit-user-form" autocomplete="off">
		    	<table class="form-table">
		    		<tr>
		    			<th align="right">用户名：</th>
		    			<td>
		    				<input type="text" name="username" id="editUsername"  class="easyui-textbox add-input" data-options="required:true"/>
		    				<font color="red">*</font>
		    				<input type="hidden" name="id" id="userId"/>
		    			</td>
		    		</tr>
		    		<tr >
		    			<th align="right">姓名：</th>
		    			<td>
		    				<input type="text" id="editRealname" name="realname" class="easyui-textbox add-input" data-options="required:true"/>
		    				<font color="red">*</font>
		    			</td>
		    		</tr>
		    		<tr>
		    			<th align="right">邮箱：</th><td><input type="text" name="email"  id="editMail" class="easyui-textbox add-input"/>
		    				</td>
		    		</tr>
		    		<tr>
		    			<th align="right">手机：</th><td><input type="text" name="phone" id="editPhone"  class="easyui-textbox add-input" data-options="validType:'IsMobilePhone'"/>
		    				</td>
		    		</tr>
	    			<tr>
		    			<th align="right">备注：</th>
		    			<td>
		    				<input type="text" name="remark" id="editRemark"  class="easyui-textbox add-input"/>
	    				</td>
		    		</tr>
		    		<tr>
		    			<th align="right">有效性：</th>
		    			<td><select id="userStatusList" name="status" class="easyui-combobox add-input"  data-options="required:true" editable="false"> </select>
		    				<font color="red">*</font>
		    			</td>
		    		</tr>
		    	</table>
		    	<br/>
		    	<div style="text-align: center;">
		    		<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-save" onclick="javascript:submitSaveUser();">提交</a>
		    		&nbsp;&nbsp;&nbsp;
					<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#edit-user-box').dialog('close');">关闭</a>
		    	</div>
		    </form>  
		</div> 
		
		<div id="edit-user-role-box" class="easyui-window" title="配置用户角色" style="width:300px;height:400px;display:none;left:500px;top:80px;background:#fafafa;"
		        closed="true" modal="true" collapsible="false" minimizable="false" maximizable="false" draggable="false" resizable="false">  
			<div id="role-list-box" style="padding:20px;"></div>
			<div style="margin-top:30px;text-align:center;position:absolute;left:120px;bottom:15px;"><a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveUserRole();">确定</a></div>
		</div> 
		
		<div id="edit-user-site-box" class="easyui-window" title="配置用户站点" style="width:300px;height:400px;display:none;left:500px;top:80px;background:#fafafa;"
		        closed="true" modal="true" collapsible="false" minimizable="false" maximizable="false" draggable="false" resizable="false">  
			<div id="site-list-box" style="padding:20px;"></div>
			<div style="margin-top:30px;text-align:center;position:absolute;left:120px;bottom:15px;"><a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveUserSite();">确定</a></div>
		</div> 
		
		<script type="text/javascript" src="${request.contextPath}/style/web/js/portal-user.js?v=${version}"></script>
	</body>
</html>